#include "window.h"
#include <QPushButton>
#include <QMessageBox>
#include "command/TestCommand.h"
#include "widgets/bottomWidgetContent/RightWidget.h"
#include "command/NewWindowRightWidgetCommand.h"

window::window(QWidget *parent)
    : QMainWindow(parent)
{
    // 窗口基本设置
    setWindowTitle("简单的Qt示例");
    resize(1200, 800);

    // 创建并设置中心部件
    QWidget *centralWidget = new QWidget(this);
    setCentralWidget(centralWidget);

    // 主布局设置（使用智能指针管理内存）
    QVBoxLayout *mainLayout = new QVBoxLayout(centralWidget); // 垂直布局
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0, 0, 0, 0);

    m_topWidget = new TopWidget(centralWidget);
    mainLayout->addWidget(m_topWidget);

    m_bottomWidget = new BottomWidget(centralWidget);
    mainLayout->addWidget(m_bottomWidget, 1);

    // 配置 TopWidget
    m_topWidget->setTitle("卫星数据");
    m_topWidget->addActionButton("新窗口", new NewWindowRightWidgetCommand());
}